<h:panelGroup xmlns:h='http://java.sun.com/jsf/html'
              xmlns:f='http://java.sun.com/jsf/core'
              xmlns:p='http://primefaces.org/ui'
              xmlns:z='http://savanti.com.bo/ui'
              xmlns:x='http://java.sun.com/jsf/composite/ui/component' styleClass='IIVentasClienteChart' id='IIVentasClienteChart'><p:growl id='growl'/>

<p:toolbar styleClass='toolBar'>

<p:toolbarGroup style='width:100%'>

<p:commandButton icon='ui-icon-new'  title='Nuevo' actionListener='#{IIVentasClienteChart.uiClean}'  update='@(.IIVentasClienteChart)' style='width:70px;border: none;' process='@this'/>

<p:commandButton id='#{formId}btnTitle' value='GRAFICA' style='width:10%;position:absolute;left:40%;background: transparent;border: none;font-weight: bold' actionListener='#{IIVentasClienteChart.uiForm}'  update='@(.IIVentasClienteChart)' process='@this'/>

<p:commandButton icon='ui-icon-find' title='Buscar'  actionListener='#{IIVentasClienteChart.uiFind}'   update='@(.IIVentasClienteChart)' style='width:70px;float:right;border: none' process='@(.IIVentasClienteChart)'/>

</p:toolbarGroup>

</p:toolbar>


<p:contextMenu for='#{formId}btnTitle' style='width:80px' rendered='#{not empty IIVentasClienteChart.lsEntity}'>

<p:menuitem icon='ui-icon-print' style='padding-left:8px' value='.. csv' ajax='false'><p:dataExporter type='csv' target='view:tblPrd' fileName='RESUMEN VENTAS X CLIENTE'/></p:menuitem>

<p:menuitem icon='ui-icon-print' style='padding-left:8px' value='.. xls' ajax='false'><p:dataExporter type='xls' target='view:tblPrd' fileName='RESUMEN VENTAS X CLIENTE'/></p:menuitem>

<p:menuitem icon='ui-icon-search' style='padding-left:8px' value='.. Filtrar' actionListener='#{IIVentasClienteChart.uiFilter}'  update='@(.IIVentasClienteChart)' process='@this'/>

</p:contextMenu>


<h:panelGrid columns='2' width='100%' rendered='#{IIVentasClienteChart.form}'>

  <h:panelGrid id='bean' columns='2' styleClass='bean align-top'>

  <x:beanPanel id='hd' bean='#{IIVentasClienteChart}' title='Resumen' cellpadding='8'>

  <x:fieldN t='Importe'   v='#{bean.entity.importe}'   w='150px'/>

  <x:fieldN t='Cantidad'  v='#{bean.cantidad}' r='0'   w='150px'/>

  <x:fieldN t='Desc.'     v='#{bean.entity.descuento}' w='150px'/>

  <x:fieldC t='Pedidos'   v='#{bean.pedido}'           w='60px'  b='#{bean}'/>

  <x:fieldN t='Total'     v='#{bean.entity.total}'     w='150px' style='color:#ffcc25'/>

  </x:beanPanel>


  <x:beanPanel id='ps' bean='#{IIVentasClienteChart}' title='Buscar' cellpadding='6' columns='1' style='min-width: 300px'>

  <x:fieldS t='Cliente' v='#{bean.entity.cliente}' w='250px' x='#{x}' xL='#{x.persona.nombre}' b='#{bean}'/>

  <x:fieldM b='#{bean}' t='Material' v='#{bean.material}' x='#{x}'/>

  <h:panelGrid columns='2' cellpadding='0' cellspacing='0'>

  <x:fieldD t='Desde'   v='#{bean.dateIni}' w='70px'/>

  <x:fieldD t='Hasta'   v='#{bean.dateEnd}' w='70px' sT='margin-left:17px'/>

  </h:panelGrid>

  </x:beanPanel>

  </h:panelGrid>

</h:panelGrid>


<p:tabView id='view' style='padding: 0; border: none' styleClass='rmvCorner'>

  <p:tab title='Grafica' titleStyleClass='rmvCorner note'>

  <p:chart type='line' model='#{IIVentasClienteChart.model}' rendered='#{IIVentasClienteChart.model != null}'/>

  </p:tab>

  <p:tab title='Datos' titleStyleClass='rmvCorner note'>

  <p:dataTable id='tblPrd' value='#{IIVentasClienteChart.lsEntity}' var='x' paginator='true' paginatorPosition='bottom' rows='500' resizableColumns='true' rendered='#{not empty IIVentasClienteChart.lsEntity}'

             rowIndexVar='rowInd' paginatorAlwaysVisible='false' emptyMessage='' selectionMode='single' rowKey='#{x[0]}' filteredValue='#{IIVentasClienteChart.lsFiltered}' style="width:100%;background: transparent">

  <p:column sortBy='#{x[0]}' style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Fecha'   /></f:facet><h:outputText value='#{x[0]}'><f:convertDateTime pattern='dd-MM-yyyy'/></h:outputText></p:column>

  <p:column sortBy='#{x[1]}' style='background:transparent;width:55px'>                 <f:facet name='header'><h:outputText value='Cantidad'/></f:facet><z:outputN v='#{x[1]}' r='0'/></p:column>

  <p:column sortBy='#{x[2]}' style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Importe' /></f:facet><z:outputN v='#{x[2]}'/>      </p:column>

  <p:column sortBy='#{x[3]}' style='background:transparent;width:50px'>                 <f:facet name='header'><h:outputText value='Desc.'   /></f:facet><z:outputN v='#{x[3]}'/>      </p:column>

  <p:column sortBy='#{x[4]}' style='background:transparent;width:50px;font-weight:bold'><f:facet name='header'><h:outputText value='Total'   /></f:facet><z:outputN v='#{x[4]}'/>      </p:column>

  </p:dataTable>

  </p:tab>

</p:tabView>

</h:panelGroup>    